#ifndef RS_LOG_H
#define RS_LOG_H
#include "rs_string.h"
#include "rs_stream.h"

extern rs_ostream* log_ofs;

extern void rs_log_set_time_stamps (bool value);


void rs_log_base (const rs_string& message, bool to_console=true, const rs_string& key=L"");

inline void rs_log_console (const rs_string& message)
{
    rs_log_base (message + L"\r\n");
}


inline void rs_log_file (const rs_string& fixed_message,
                         const rs_string& variable_message=L"")
{
    rs_log_base (fixed_message + variable_message +
        L"\r\n", false);
}


inline void rs_log_init (const rs_string& message)
{
    rs_log_base (message);
}

inline void rs_report_error (const rs_string& fixed_message, const rs_string& variable_message=L"")
{
    rs_log_base (L"error: " + fixed_message + variable_message + L"\r\n", true, fixed_message);
}


#endif